package com.weaponlin.domain;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 将一个long的时间数去掉以及毫秒数
 */
public class ExceptSecond {
    public static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");

    public static void main(String[] args) {
        long time1 = System.currentTimeMillis();
        Date d1 = new Date(time1);
        System.out.println(sdf.format(d1));
        long time2 = time1 / 60000 * 60000;
        Date d2 = new Date(time2);
        System.out.println(sdf.format(d2));
    }
}
